package Java编程的逻辑.第八章.泛型.解析通配符;

public class Base implements Comparable<Base>{
    private int sortOrder;
    public Base(int sortOrder) {
        this.sortOrder = sortOrder;
    }

    @Override
    public int compareTo(Base o) {
        if(sortOrder < o.sortOrder) {
            return -1;
        } else if(sortOrder > o.sortOrder) {
            return 1;
        } else {
            return 0;
        }
    }
}

class Child extends Base {
    public Child(int sortOrder) {
        super(sortOrder);
    }
}
